Lorenzo Biasi and Michael Aichmüller

Exercise 1.

Let's say that A is the event "car is green" and B is the event that "he sees a green car". We want to compute the probability that the car is green given that he sees a green car. For that we will use extended Bayes theorem:

$P(A\mid B) = \frac{P(B\mid A)\,P(A)}{ P(B\mid A) P(A) + P(B\mid \neg A) P(\neg A)}$

$P(A) = 0.15$

$P(\neg A) = 0.85$

$P(B\mid A) = 0.80$

$P(B\mid \neg A) = 0.20$

The result $P(A\mid B) = 41.379 \%$


In [4]:
0.8 * .15 / (0.8 * .15 + .2 * .85)


Out[4]:
0.4137931034482758

Exercise 2.

Let's say that A is the event "dot was sent" and B is the event that "dot is received". We want to compute the probability that a dot was sent given a dot was received. For that we will use extended Bayes theorem:

$P(A\mid B) = \frac{P(B\mid A)\,P(A)}{ P(B\mid A) P(A) + P(B\mid \neg A) P(\neg A)}$

$P(A) = 3 / 7$

$P(\neg A) = 4 / 7$

$P(B\mid A) = 3 / 4$

$P(B\mid \neg A) = 1 / 3$

The result $P(A\mid B) = 62.791 \%$


In [5]:
((3 / 4) * (3 / 7)) / ((3 / 4) * (3 / 7) + (1 / 3) * (4 / 7))


Out[5]:
0.627906976744186

Exercise 3.

Let's say that A is the event "the student actually knows the answer" and B is the event that "student aswered the question correctly". We want to compute the probability that at he student actually knows the answer given that student aswered the question correctly. For that we will use extended Bayes theorem:

$P(A\mid B) = \frac{P(B\mid A)\,P(A)}{ P(B\mid A) P(A) + P(B\mid \neg A) P(\neg A)}$

$P(A) = p$

$P(\neg A) = 1 - p$

$P(B\mid A) = 1$

$P(B\mid \neg A) = 1 / 5$

The result $P(A\mid B) = \frac{p}{p + \frac{1 -p}{5}} \%$

Exercise 4

\begin{align} \langle u+v,u-v \rangle &= \langle u,u \rangle - \langle u,v \rangle + \langle v,u \rangle - \langle v,v\rangle \\ &= \langle u,u \rangle - \langle v,v \rangle \\ \|u+v\|^2 - \| u-v\|^2 &= \langle u + v, u+v\rangle - \langle u-v,u-v \rangle\\ &= \langle u,u \rangle + 2\langle u,v \rangle + \langle v,v \rangle - \langle u,u \rangle + 2 \langle v,u \rangle - \langle v,v \rangle\\ &= 4 \langle u,v\rangle \\ \|u+v\|^2+\|u-v\|^2 &= \langle u+v, u+v\rangle + \langle u-v, u-v\rangle\\ &= \langle u, u+v\rangle +\langle v, u+v\rangle \ +\ \langle u, u-v\rangle - \langle v, u-v\rangle\\ &= \langle u, u \rangle +\langle u, v\rangle + \langle v, u \rangle +\langle v, v\rangle \ +\ \langle u, u\rangle - \langle u, v\rangle - \langle v, u\rangle + \langle v, v\rangle\\ &= 2\langle u, u \rangle + 2\langle v, v\rangle = 2\|u\|^2+2\|v\|^2 \end{align}

In [ ]: